package com.example.administrator.zhongyichou.help;

import android.text.TextUtils;

import com.example.administrator.zhongyichou.net.NetConfig;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lichenyu on 2017/11/28.
 * 描述：
 */

public class StringImageToList {

    /**
     * 图片拼接转成list
     *
     * @param image
     * @return
     */
    public static List<String> toList(String image) {
        List<String> list = new ArrayList();
        if (TextUtils.isEmpty(image)) {
            return list;
        }
        String[] strings = image.split(",");
        for (String string : strings) {
            list.add(NetConfig.BASE_URL + "upload" + string);
        }
        return list;
    }

    /**
     * 拼接图片
     *
     * @param string
     * @return
     */
    public static String toImage(String string) {
        return NetConfig.BASE_URL + "upload" + string;
    }
}
